<?php

 
 $imageGalleryDirectory = "images/yourFolderNameHere/" ;
 
 require "includes/functions.php";
 require "includes/image.inc.php";
 
 $imageArray = get_directory_listing( $imageGalleryDirectory );
 
 if (count($imageArray) > 0 ) {
 	for ($i=0; $i<count($imageArray);$i++) {	
 		
 		if (!file_exists($imageGalleryDirectory."thumbs/")) {
 			mkdir($imageGalleryDirectory."thumbs/");
 		}	
 		
 	
 		if (!file_exists( $imageGalleryDirectory."thumbs/".$imageArray[$i])) {
	 		$tempImage = get_image_from_file($imageGalleryDirectory.$imageArray[$i]);
	 		$tempThumbnail = resize_img_proportional($tempImage, 100, "Y");
	 		write_image_file($tempThumbnail, $imageGalleryDirectory."thumbs/".$imageArray[$i], "jpg", 100);
 		}
 	}
 }
 
?>
